export const blob2arrayBuffer = async (blob: Blob): Promise<ArrayBuffer> => {
  return new Promise((resolve, reject) => {
    try {
      var fr = new FileReader(); //FileReader可以读取Blob内容
      fr.readAsArrayBuffer(blob); //二进制转换成ArrayBuffer
      fr.onerror = (e) => {
        reject(e);
      };
      fr.onload = (e) => {
        resolve(fr.result as ArrayBuffer);
      };
    } catch (error) {
      reject(error);
    }
  });
};
